package mat.xls;

public class Mat {
    public String category;
    public String name;
    public String model;
    public int price;

    @Override
    public String toString() {
        return "Mat{" +
                "category='" + category + '\'' +
                ", name='" + name + '\'' +
                ", model='" + model + '\'' +
                ", price=" + price +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Mat mat = (Mat) o;

        if (category != null ? !category.equals(mat.category) : mat.category != null) return false;
        if (model != null ? !model.equals(mat.model) : mat.model != null) return false;
        if (name != null ? !name.equals(mat.name) : mat.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = category != null ? category.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (model != null ? model.hashCode() : 0);
        return result;
    }

    public static String trimModel(String model) {
//        model = model.replace("Long", "");
        return model;
    }
}
